home *** CD-ROM | disk | FTP | other *** search
/ Wayzata's Best of Shareware PC/Windows 2 / Wayzata's Best of Shareware 2.0 (Windows) (Wayzata Technology)(7112)(1994).bin / pc / dos / programg / pbwiz15 / demo.bas < prev    next >
BASIC Source File  |  1992-06-30  |  5KB  |  183 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |         PBWIZ  Copyright (c) 1991-1992  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      PowerBASIC Wizard's Library                     |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    $INCLUDE "pbwiz.inc"
  10.  
  11.    $LINK "equipmen.obj"
  12.    $LINK "videoa.obj"
  13.    $LINK "videob.pbu"
  14.  
  15.    DEFINT A-Z
  16.  
  17.  
  18. '  ----- Pick the colors to use -----------------------------------------------
  19.  
  20.  
  21.    CALL GetDisplay (Adapter, Mono)
  22.  
  23.    IF Mono THEN
  24.       Attr = CalcAttr (7, 0)
  25.    ELSE
  26.       Attr = CalcAttr (7, 1)
  27.    END IF
  28.  
  29.  
  30. '  ----- Clear the screen and pop up the window -------------------------------
  31.  
  32.  
  33.    CLS
  34.  
  35.    Fore = 15
  36.    IF Mono THEN
  37.       Back = 0
  38.    ELSE
  39.       Back = 1
  40.    END IF
  41.    Attr = CalcAttr(Fore, Back)
  42.    Frame = 1
  43.    Grow = 15
  44.    Shade = 0
  45.    Title$ = "PBWiz Demo"
  46.    CALL PopWindow (2, 2, 23, 77, Frame, Attr, Grow, Shade, 10, Title$)
  47.  
  48.  
  49. '  ----- Add a text note inside the window ------------------------------------
  50.  
  51.  
  52.    Row = 3
  53.    CALL XQPrint ("This is an admittedly trivial demo for the PBWiz library.  I'll", Row, 3, Attr)
  54.    Row = Row + 1
  55.    CALL XQPrint ("improve it drastically in later versions.  However, for now it will", Row, 3, Attr)
  56.    Row = Row + 1
  57.    CALL XQPrint ("provide an example of how to access the PBWiz routines.", Row, 3, Attr)
  58.    Row = Row + 2
  59.  
  60.  
  61. '  ----- Display processor type -----------------------------------------------
  62.  
  63.  
  64.    SELECT CASE Processor
  65.       CASE 1: St$ = "8088"
  66.       CASE 2: St$ = "80186"
  67.       CASE 3: St$ = "80286"
  68.       CASE 4: St$ = "80386"
  69.       CASE ELSE: St$ = "80?86"
  70.    END SELECT
  71.    CALL XQPrint ("Processor: " + St$, Row, 3, Attr)
  72.    Row = Row + 1
  73.  
  74.  
  75. '  ----- Display DOS version --------------------------------------------------
  76.  
  77.  
  78.    CALL GetDOSv (MajorV, MinorV)
  79.    DOSv$ = STR$(MajorV) + "." + RIGHT$("0" + LTRIM$(STR$(MinorV)), 2)
  80.    St$ = ""
  81.    IF MajorV > 9 THEN St$ = "   OS/2 Compatibility Box"
  82.    IF DRDOS THEN St$ = " (DR DOS)"
  83.    CALL XQPrint ("DOS version:" + DOSv$ + St$, Row, 3, Attr)
  84.    Row = Row + 1
  85.  
  86.  
  87. '  ----- Display basic equipment info -----------------------------------------
  88.  
  89.  
  90.    CALL XQPrint ("Floppy drives:" + STR$(Floppies), Row, 3, Attr)
  91.    Row = Row + 1
  92.  
  93.  
  94. '  ----- Display video adapter type -------------------------------------------
  95.  
  96.  
  97.    SELECT CASE Adapter
  98.       CASE 1: St$ = "MDA"
  99.       CASE 2: St$ = "Hercules"
  100.       CASE 3: St$ = "CGA"
  101.       CASE 4: St$ = "EGA"
  102.       CASE 5: St$ = "MCGA"
  103.       CASE 6: St$ = "VGA"
  104.    END SELECT
  105.    IF Mono THEN
  106.       St$ = St$ + " on a monochrome monitor"
  107.    ELSE
  108.       St$ = St$ + " on a color monitor"
  109.    END IF
  110.    CALL XQPrint ("Display: " + St$, Row, 3, Attr)
  111.    Row = Row + 1
  112.  
  113.  
  114. '  ----- Display BIOS date and type -------------------------------------------
  115.  
  116.  
  117.    CALL XQPrint ("ROM BIOS date: " + PCDate$, Row, 3, Attr)
  118.    Row = Row + 1
  119.  
  120.    SELECT CASE PCType
  121.       CASE 251, 254, 255: St$ = "PC/XT"
  122.       CASE 253: St$ = "PCjr"
  123.       CASE 252: St$ = "PC AT": ATtype = -1
  124.       CASE 250: St$ = "PS/2 Model 30"
  125.       CASE 249: St$ = "PC Convertible"
  126.       CASE 248: St$ = "PS/2 Model 70 or 80": ATtype = -1
  127.       CASE 45, 154: St$ = "Compaq Portable"
  128.       CASE ELSE: St$ = "unknown"
  129.    END SELECT
  130.    CALL XQPrint ("Computer type: " + St$, Row, 3, Attr)
  131.    Row = Row + 1
  132.  
  133.  
  134. '  ----- Display extended and expanded memory info ----------------------------
  135.  
  136.  
  137.    IF ATtype THEN
  138.       CALL XQPrint ("Extended memory (BIOS):" + STR$(GetExtM&) + " Kbytes", Row, 3, Attr)
  139.       Row = Row + 1
  140.    END IF
  141.  
  142.    IF ATtype THEN
  143.       CALL GetXMSv (MajorV, MinorV)
  144.       CALL GetXMSm (LargeBlock&, TotalFree&)
  145.       IF MajorV OR MinorV THEN
  146.          St$ = STR$(MajorV) + "." + RIGHT$("0" + LTRIM$(STR$(MinorV)), 2)
  147.          CALL XQPrint ("Extended memory (XMS):", Row, 3, Attr)
  148.          Row = Row + 1
  149.          CALL XQPrint ("   Version:" + St$, Row, 3, Attr)
  150.          Row = Row + 1
  151.          CALL XQPrint ("   Free   :" + STR$(TotalFree&) + " Kbytes", Row, 3, Attr)
  152.          Row = Row + 1
  153.       END IF
  154.    END IF
  155.  
  156.    CALL GetEMSm (TotalPages, FreePages)
  157.    IF TotalPages THEN
  158.       CALL GetEMSv (MajorV, MinorV)
  159.       St$ = STR$(MajorV) + "." + RIGHT$("0" + LTRIM$(STR$(MinorV)), 2)
  160.       CALL XQPrint ("Expanded memory:", Row, 3, Attr)
  161.       Row = Row + 1
  162.       CALL XQPrint ("   Version:" + St$, Row, 3, Attr)
  163.       Row = Row + 1
  164.       CALL XQPrint ("   Total  :" + STR$(TotalPages * 16) + " Kbytes", Row, 3, Attr)
  165.       Row = Row + 1
  166.       CALL XQPrint ("   Free   :" + STR$(FreePages * 16) + " Kbytes", Row, 3, Attr)
  167.       Row = Row + 1
  168.    END IF
  169.  
  170.    St$ = STR$(CommPorts)
  171.    CALL XQPrint ("COM ports:" + St$, Row, 3, Attr)
  172.    Row = Row + 1
  173.  
  174.    St$ = STR$(PrtPorts)
  175.    CALL XQPrint ("LPT ports:" + St$, Row, 3, Attr)
  176.    Row = Row + 1
  177.  
  178.  
  179. '  ----- Make sure the DOS prompt doesn't get in the way ----------------------
  180.  
  181.  
  182.    LOCATE 24, 1, 1
  183.